package com.ysc.dao.impl;

import com.ysc.dao.StudentDao;
import com.ysc.domain.Student;
import com.ysc.utils.mybatisUtils;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class StudentDaoImpl implements StudentDao {
    @Override
    public List<Student> selectStudents() {
        SqlSession sqlSession = mybatisUtils.getSqlSession();
        String sqlID = "com.ysc.dao.StudentDao.selectStudents";
        List<Student> stus = sqlSession.selectList(sqlID);
        for (Student stu :stus){
            System.out.println(stu);
        }
        sqlSession.close();
        return stus;
    }
}
